# C compiler options
CXX	= g++
CXXFLAGS	= -g -O2 -std=gnu++11          
TARGET	=	main
#LIBSPATH = ../lib

#PLATFORM = linux32
#LIBS	= /usr/local/lib -lusb-1.0
#LIBS	= /usr/local/lib/libusb-1.0.a -lm -lpthread
LIBS = -L../Livox-SDK/build/sdk_core -llivox_sdk_static -lm -lpthread -lstdc++
#add libs for gps
#LIBS += -L../libusb-1.0.22/build/lib -lusb-1.0 -ludev
LIBS += -L/usr/local/lib/ -lusb-1.0 -ludev
#add libs for lpms
LIBS += -L../lpms/lpmsig1opensourcelib/build -lLpmsIG1_OpenSourceLib -lrt
#add libs for pps
LIBS += -lwiringPi

INC	= -I. -I../Livox-SDK -I../Livox-SDK/sample/lidar_lvx_file -I../Livox-SDK/sdk_core/include

INC += -I../Livox-SDK/sdk_core/include/third_party/cmdline/

#add include path for gps
INC += -I../libusb-1.0.22/build/include -I../gps
#add include path for lpms
INC += -I../lpms/lpmsig1opensourcelib/linux_example -I../lpms/lpmsig1opensourcelib
#add include path for pps
INC += -I../pps
 
#多字节字符 指定汉字编码方式UTF-8
EXCHAR	= -fexec-charset=UTF-8    
 
# Source files
SRCS = main.cpp time_info.cpp ../Livox-SDK/sample/lidar_lvx_file/lvx_int.cpp
SRCS += ../Livox-SDK/sample/lidar_lvx_file/lvx_file.cpp
#add gps source file
SRCS += ../gps/gprmc.cpp
#add lpms source file
SRCS += ../lpms/lpmsig1opensourcelib/linux_example/lpms_int.cpp
SRCS += ../lpms/lpmsig1opensourcelib/LpMatrix.cpp

#add pps source file
SRCS += ../pps/pps.cpp
 
# Object files
OBJS	= $(SRCS:.cpp=.o)
 
# Make everything
all:	$(TARGET) 
 
# Make the application
#-lstdc++:编译c++的时候用到
$(TARGET): $(OBJS)
	$(CXX) $(CXXFLAGS) $(EXCHAR) -o $(TARGET) $(OBJS)  $(LIBS) 
 
# Dependencies
#$@:表示目标文件，即：demo.o
#$<：表示依赖文件，即：demo.c
#-I$(INC) :指向包含了的.h文件的路径 即wbe,h的路径
$(OBJS): %.o: %.cpp 
	$(CXX) -c $(CXXFLAGS) $(EXCHAR) -o $@ $< $(INC)  
#
# Clean all object files...
#
 
clean:
	$(RM) $(OBJS) $(TARGET) 
 
